<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org"
      xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head th:include="include :: header"></head>
<style>
    #tableMain{
        margin: 0 auto;
        border: #333 solid 1px;
        width: 100%;
    }
    #tableMain td{
        border: #333 solid 1px;
        padding: 10px;
    }
    .row{
        line-height: 260%;
    }
    #table1 td{
        border: #0a0a0a 1px solid;
        padding: 5px;
    }
    #tableMain1 td{
        border: #0a0a0a 1px solid;
        padding: 5px;
    }
    .control-label{
        font-weight: 300;
    }
</style>
<body class="hold-transition skin-yellow sidebar-mini">

<div style="display: none">
    <input id="id" type="hidden" style="display: none" th:value="${id}"/>
</div>
<section class="content">
    <div class="row">
        <div class="col-md-10 col-md-push-1">
            <div class="box">
                <div class="box-body">
                    <button type="button" id="btn-print" onclick="Print('#printDiv')" class="pull-right btn btn-info">打印</button>
                    <div id="printDiv">
                    <div  class="col-xs-10 col-xs-push-1" >
                        <form id="data" class="form-horizontal" style="font-size: 18px;">
                            <div class="row" style="padding:50px 15px 15px 15px;">
                            <table id="table1" style="width: 100%;">
                                <tr>
                                    <td colspan="4" style="border: none;text-align: center;vertical-align: middle">
                                        <img th:src="@{/img/logo3.jpg}" width="64px" height="40px" style="margin-top: -30px">
                                        <div style="display: inline-block;margin-top: 5px;margin-left: 5px">
                                            <span style="letter-spacing: 21px;display: block;line-height: 20px">&nbsp;辽宁忠旺机械设备制造有限公司</span>
                                            <span style="display: block;font-size: 12px;line-height: 20px;letter-spacing: 2.8px;padding-left:10px;">Liaoning Zhongwang Machinery Equipment Manufacturing Co., Ltd.</span>
                                        </div>
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="4" style="text-align: center;vertical-align: middle;padding-bottom: 25px;">
                                        <h1 style="display: inline-block">电子转序单</h1>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="44%" colspan="2">
                                        <label class="control-label">当前序：</label>
                                        <label class="control-label"><span id="route"></span></label>
                                    </td>
                                    <td width="56%" colspan="2">
                                        <label class="control-label">创建日期：</label>
                                        <label class="control-label"><span id="createTime"></span></label>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="44%" colspan="2">
                                        <label class="control-label">生产令编号：</label>
                                        <label class="control-label"><span id="prodNo"></span></label>
                                    </td>
                                    <td width="56%" colspan="2">
                                        <label class="control-label">项目名称：</label>
                                        <label class="control-label"><span id="proName"></span></label>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="22%">
                                        <label class="control-label">生产令数量：</label>
                                        <label class="control-label"><span id="proNum"></span></label>
                                    </td>
                                    <td width="22%">
                                        <label class="control-label">类型：</label>
                                        <label class="control-label"><span id="special"></span></label>
                                    </td>
                                    <td width="56%" colspan="2">
                                        <label class="control-label">部分：</label>
                                        <label class="control-label"><span id="part"></span></label>
                                    </td>
                                </tr>
                                <tr>
                                    <td width="44%" colspan="2">
                                        <label class="control-label">零件图号：</label>
                                        <label class="control-label"><span id="drawNo"></span></label>
                                    </td>
                                    <td width="40%" >
                                        <label class="control-label">零件名称：</label>
                                        <label class="control-label"><span id="drawName"></span></label>
                                    </td>
                                    <td width="16%">
                                        <label class="control-label">零件数量：</label>
                                        <label class="control-label"><span id="drawNum"></span></label>
                                    </td>
                                </tr>
                            </table>
                            </div>
<!--                            <div class="row"  style="text-align: center;padding-top: 50px">-->
<!--                               -->
<!--                            </div>-->
<!--                            <div class="row">-->
<!--                                <div class="col-md-3">-->
<!--                                    -->
<!--                                </div>-->
<!--                            </div>-->
<!--                            <div class="row">-->
<!--                                <div class="col-md-3">-->
<!--                                    <label class="control-label">生产令编号：</label>-->
<!--                                    <label class="control-label"><span id="prodNo"></span></label>-->
<!--                                </div>-->
<!--                                <div class="col-md-3">-->
<!--                                    <label class="control-label">生产令数量：</label>-->
<!--                                    <label class="control-label"><span id="proNum"></span></label>-->
<!--                                </div>-->
<!--                                <div class="col-md-3">-->
<!--                                    <label class="control-label">类型：</label>-->
<!--                                    <label class="control-label"><span id="special"></span></label>-->
<!--                                </div>-->
<!--                                <div class="col-md-3">-->
<!--                                    <label class="control-label">部分：</label>-->
<!--                                    <label class="control-label"><span id="part"></span></label>-->
<!--                                </div>-->
<!--                            </div>-->
<!--                            <div class="row">-->
<!--                                <div class="col-md-3">-->
<!--                                    <label class="control-label">零件图号：</label>-->
<!--                                    <label class="control-label"><span id="drawNo"></span></label>-->
<!--                                </div>-->
<!--                                <div class="col-md-3">-->
<!--                                    <label class="control-label">零件名称：</label>-->
<!--                                    <label class="control-label"><span id="drawName"></span></label>-->
<!--                                </div>-->
<!--                                <div class="col-md-3">-->
<!--                                    <label class="control-label">零件数量：</label>-->
<!--                                    <label class="control-label"><span id="drawNum"></span></label>-->
<!--                                </div>-->
<!--                            </div>-->
                            <div class="row" style="padding-left: 15px;padding-right: 15px;padding-bottom: 15px;padding-top: 0;">
                                <table id="tableMain1" style="width: 100%">
                                    <tr>
                                        <td width="33%">转出人：<span id="applyName"></span></td>
                                        <td width="33%">转出时间：<span id="applyTime"></span></td>
                                        <td width="34%">转出车间：<span id="applyDept"></span></td>
                                    </tr>
                                    <tr>
                                        <td>质检员：<span id="checkName"></span></td>
                                        <td>质检时间：<span id="checkTime"></span></td>
                                        <td>质检意见：<span id="opinion"></span></td>
                                    </tr>
                                    <tr id="trRec">
                                        <td>接收人：<span id="recName"></span></td>
                                        <td>接收时间：<span id="recTime"></span></td>
                                        <td>接收车间：<span id="recDept"></span></td>
                                    </tr>
                                </table>
                            </div>
                        </form>
                    </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</section>
<div th:include="include :: footer"></div>
<script th:inline="javascript">
    $(function () {
        loadData();
    });

    /** 获取转序单信息 */
    function loadData() {
        js.post({
            url: ctx + "flow/transquery/loadTransOrderData",
            data: {
                id: $("#id").val()
            },
            success: function (result) {
                if (result.type === web_status.SUCCESS) {
                    if(result.data.nextRoute === '转储' || result.data.nextIsLastRoute === 1){
                        $("#trRec").hide()
                    }
                    $("#data").fillSpan(result.data);
                } else {
                    js.modal.warning(result.msg);
                }
            }
        });
    }
    /**
     * 打印
     */
    function startPrint() {
        let title = document.title;
        document.title = "\u200E";
        $("#btn-print").hide();
        $("#printDiv").printArea();
        document.title = title;
        $("#btn-print").show();

    }
</script>
</body>
</html>
